package org.pku_uestc.hackathon.bean;

/**
 * sensor element，保存預設的sensor信息
 * 
 * @author Jason_wbw
 * 
 */

public class SensorInfo {

	private int sensorType; 
	private int sensorId; 

	public SensorInfo(int value) {
		sensorId = value/100;
		sensorType = value%100;
	}
	
	public int getSensorType() {
		return sensorType;
	}
	
	public void setSensorType(int sensorType) {
		this.sensorType = sensorType;
	}
	
	public int getSensorId() {
		return sensorId;
	}
	
	public void setSensorId(int sensorId) {
		this.sensorId = sensorId;
	}
	
	@Override
	public SensorInfo clone() {
		return new SensorInfo(sensorId*100+sensorType);
	}

	@Override
	public int hashCode() {
		return sensorId*100+sensorType;
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof SensorInfo) {
			SensorInfo other = (SensorInfo) o;
			if (other.sensorId == sensorId
					&& other.sensorType == sensorType)
				return true;
		}
		return false;
	}
	
	@Override
	public String toString(){
		return ""+(sensorId*100+sensorType);
	}
}
